#ifndef RENDER_ENGINE_H_
#define RENDER_ENGINE_H_

#include <string>
#include "scene.h"
#include "render_system/gl_render_system_define.h"

class RenderEngine
{
public:
    GL_RENDER_SYSTEM_API static RenderEngine& ref();

    GL_RENDER_SYSTEM_API void init(const std::string& windowName = "OpenGL Test Window");
    GL_RENDER_SYSTEM_API void setScene(const ScenePtr pScene);
    GL_RENDER_SYSTEM_API void run();

private:
    RenderEngine() {}
    void _registerEvent();

private:
    // wrapper function
    static void _onRenderWrapper();
    static void _onSizeChangedWrapper(int width, int height);

    static void _onMouseButtonEventWrapper(int button,int state, int x,int y);
    static void _onMouseMoveWrapper(int x, int y);

    static void _onKeyboardWrapper(unsigned char key, int x, int y);
    static void _onSpecialKeyPressedWrapper(int key, int x, int y);
private:
    static RenderEngine _singleton;
    ScenePtr           _pScene;
};

#endif